//引入Vue组件
import Vue from 'vue';

//4.0引入路由对应的组件
import homeContainer from '../components/homeContainer/home.vue';
import memberContainer from '../components/memberContainer/member.vue';
import shopcarContainer from '../components/shopcarContainer/shopcar.vue';
import searchContainer from '../components/searchContainer/search.vue';
import newsList from '../components/homeContainer/news/newsList.vue';
import newsInfo from "../components/homeContainer/news/newsInfo.vue";
//4.1引入vue-router组件
import VueRouter from "vue-router";
//4.2挂载在Vue上
Vue.use(VueRouter);
//4.3创建路由规则,创建路由规则时,可以给选中的路由添加类型(控制选中效果),使用linkActiveClass属性
var router = new VueRouter({
  routes:[
    {path:"/",redirect:'/home'},
    {path:'/home',component:homeContainer},
    {path:'/member',component:memberContainer},
    {path:'/shopcar',component:shopcarContainer},
    {path:'/search',component:searchContainer},
    {path:'/home/newslist',component:newsList},
    {path:'/home/newsInfo/:id',component:newsInfo}
  ],
  linkActiveClass:"mui-tab-item mui-active router-link-exact-active"//给路由设置类名(实现高亮的效果)
})

export default router;
